package com.soft.javase.ch04.duotai;

/**
 * @author wangzhisen
 * @Desc TODO
 * @date 2025/4/22
 */
public class Dog extends Animal{

    private String player;

    public void kanjia(){
        System.out.println(this.getName() + "正在和"+player+"一起看家");
    }

    //重写eat()


    @Override
    public void eat(Animal a) {
        System.out.println(this.getName()+"和"+player+"一起去吃饭...");
    }

    public Dog() {
    }

    public Dog(String name,String color, int age, String player) {
        super(name, color, age);
        this.player = player;
    }


    /**
     * 获取
     * @return player
     */
    public String getPlayer() {
        return player;
    }

    /**
     * 设置
     * @param player
     */
    public void setPlayer(String player) {
        this.player = player;
    }

    public String toString() {
        return "Dog{player = " + player + "}"+super.toString();
    }
}
